package org.kailu.book.entity;
// default package
// Generated Jun 2, 2014 10:09:11 AM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Department generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "department", catalog = "book")
public class DepartmentEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer departmentId;
	private String departmentName;
	private Set<ExportEntity> exports = new HashSet<ExportEntity>(0);

	public DepartmentEntity() {
	}

	public DepartmentEntity(String departmentName) {
		this.departmentName = departmentName;
	}

	public DepartmentEntity(String departmentName, Set<ExportEntity> exports) {
		this.departmentName = departmentName;
		this.exports = exports;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "department_id", unique = true, nullable = false)
	public Integer getDepartmentId() {
		return this.departmentId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}

	@Column(name = "department_name", nullable = false, length = 50)
	public String getDepartmentName() {
		return this.departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "department")
	public Set<ExportEntity> getExports() {
		return this.exports;
	}

	public void setExports(Set<ExportEntity> exports) {
		this.exports = exports;
	}

}
